#include<iostream>
#include<cstdlib>
using namespace std;
int fun(int* arr, int n)
{
	int* temp;
	int res = INT_MIN;
	memset(temp, 0, sizeof(temp));
	for (int i = 0,j = 0; i < n; i++) {
		temp[arr[i]]++;
		while (temp[arr[i]] > 1) {
			temp[arr[j++]]--;
		}
		res = max(res, i - j + 1);
	}
	return res;
}